// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   OpenIE.java

package com.hs;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetAddress;

public class OpenIE
{

    public OpenIE()
    {
    }

    public static void main(String args[])
        throws IOException, FileNotFoundException
    {
        InetAddress inet = InetAddress.getLocalHost();
        System.out.println((new StringBuilder("\u672C\u673A\u7684ip=")).append(inet.getHostAddress()).toString());
        String url = (new StringBuilder("http://")).append(inet.getHostAddress()).toString()+":8088/cfcd";
        showInBrowser(url);
    }

    public static boolean showInBrowser(String url)
    {
label0:
        {
            String os = System.getProperty("os.name").toLowerCase();
            Runtime rt = Runtime.getRuntime();
            try
            {
                if(os.indexOf("win") >= 0)
                {
                    rt.exec((new StringBuilder("rundll32 url.dll,FileProtocolHandler ")).append(url).toString());
                    break label0;
                }
                if(os.indexOf("mac") >= 0)
                {
                    rt.exec((new StringBuilder("open ")).append(url).toString());
                    break label0;
                }
                if(os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0)
                {
                    String browsers[] = {
                        "epiphany", "firefox", "mozilla", "konqueror", "netscape", "opera", "links", "lynx"
                    };
                    StringBuffer cmd = new StringBuffer();
                    for(int i = 0; i < browsers.length; i++)
                        cmd.append((new StringBuilder(String.valueOf(i != 0 ? " || " : ""))).append(browsers[i]).append(" \"").append(url).append("\" ").toString());

                    rt.exec(new String[] {
                        "sh", "-c", cmd.toString()
                    });
                    break label0;
                }
            }
            catch(IOException e)
            {
                return false;
            }
            return false;
        }
        return true;
    }
}
